<?php

class RegisterView {

	public $errorMessage = "<br>";

	//TODO anropa den här innifrån en for-loop i controllern. loopa meddelande arrayen från modellen för anropen.
	public function setErrorMessage($message) {
		$this -> errorMessage .= "$message<br>";
	}

	public function getRegisterButton() {
		return "<form method='post'><input type='submit' name='registerNewUser' value='Registrera ny användare'></form>";
	}

	public function getRegisterForm() {
		return " <form method='post'>
					<a href='Index.php'>Tillbaka</a>
					<fieldset>
						<legend>Registrera ny deltagare - Fyll i info</legend>
						$this->errorMessage
						" . $this->getNameForm() . "
						<br>
						" . $this->getContactForm() . "
						<br>
						" . $this->getMembershipForm() . "
						<br>
						" . $this->getNollekitForm() . "
						<br>
						" . $this->getOverallForm() . "
						<br>
						" . $this->getSittningForm("Tema sittning", 1) . "
						<br>
						" . $this->getSittningForm("GP", 2) . "
						<br>
						" . $this->getSittningForm("Grande", 3) . "
						<br>
						
						<br>
						<label for='Register' >Skicka  :</label>						
						<input type='submit' name='Register'  value='Registrera' />
					</fieldset>		
				</form>
				";
	}
	
	private function getNameForm(){
		return "<h5>Namn :</h5>
				<label for='firstName' >Förnamn :</label>
				<input type='text' size='20' name='firstName' id='firstName' value='' /><br>
				
				<label for='lastName' >Efternamn  :</label>
				<input type='text' size='30' name='newPassword' id='newPassword' value='' /><br>";
	}
	
	private function getContactForm(){
		return "<h5>Kontakt :</h5>
				<label for='number' >Mobilnummer :</label>
				<input type='text' size='20' name='number' id='number' value='' /><br>
				
				<label for='address' >Adress :</label>
				<input type='text' size='20' name='address' id='address' value='' /><br>
				
				<label for='eMail' >Mailadress :</label>
				<input type='text' size='20' name='eMail' id='eMail' value='' /><br>";
	}
	
	private function getMembershipForm(){
		return "<h5>Medlemskap :</h5>
				<label for='membershipLength'>Medlemskap (i antal år betalda) :</label>
				<select id = 'membershipLength'>
				<option value = '0'>-</option>
				<option value = '1'>1 år</option>
	            <option value = '2'>2 år</option>
	            <option value = '3'>3 år</option>
	            </select><br>";
	}	
	
	private function getNollekitForm(){
		return "<h5>Nollekit :</h5>
				<label for='nollekitIsPaidTrue' >Betalat :</label>
				<input type = 'radio'
                 name = 'nollekitIsPaid'
                 id = 'nollekitIsPaidTrue'
                 value = 'small'
                 checked = 'checked' />		                 
                 <label for='nollekitIsPaidFalse' >Inte betalat :</label>
				<input type = 'radio'
                 name = 'nollekitIsPaid'
                 id = 'nollekitIsPaidFalse'
                 value = 'small'
                 checked = 'checked' />
                 <br>
				<label for='nollekitIsReceivedTrue' >Har hämtat ut :</label>
				<input type = 'radio'
                 name = 'nollekitIsReceived'
                 id = 'nollekitIsReceivedTrue'
                 value = 'small'
                 checked = 'checked' />
                 <label for='nollekitIsReceivedFalse' >Har inte hämtat ut :</label>
				<input type = 'radio'
                 name = 'nollekitIsReceived'
                 id = 'nollekitIsReceivedFalse'
                 value = 'small'
                 checked = 'checked' />";
	}

	private function getOverallForm(){
		return "<h5>Ovve :</h5>
				<label for='overallIsPaidTrue' >Betalat :</label>
				<input type = 'radio'
                 name = 'overallIsPaid'
                 id = 'overallIsPaidTrue'
                 value = 'small'
                 checked = 'checked' />		                 
                 <label for='overallIsPaidFalse' >Inte betalat :</label>
				<input type = 'radio'
                 name = 'overallIsPaid'
                 id = 'overallIsPaidFalse'
                 value = 'small'
                 checked = 'checked' />
                 <br>
				<label for='overallSize'>Storlek :</label>
				<select id = 'overallSize'>
				<option value = '0'>-</option>
				<option value = '1'>Small</option>
	            <option value = '2'>Medium</option>
	            <option value = '3'>Large</option>
	            <option value = '4'>Extra Lars</option>
	            </select><br>";
	}
	
	private function getSittningForm($name, $number){
		return "<h5>$name :</h5>
				<label for='Sittning".$number."PaidTrue' >Betalat :</label>
				<input type = 'radio'
                 name = 'Sittning".$number."Paid'
                 id = 'Sittning".$number."PaidTrue'
                 value = 'small'
                 checked = 'checked' />		                 
                 <label for='Sittning".$number."PaidFalse' >Inte betalat :</label>
				<input type = 'radio'
                 name = 'Sittning".$number."Paid'
                 id = 'Sittning".$number."PaidFalse'
                 value = 'small'
                 checked = 'checked' />";	
	}
}

//<input type='submit' name='Back'  value='Tillbaka' />
